package com.cango.student;

import java.util.HashMap;
import java.util.Map;

public class over extends overpar {
    public void t(Map a) {
    }

    public void t(HashMap a) {
    }

    public static void invoke(Object obj, Object... args) {
        System.out.println("invoke1");
    }

    public static void invoke(String s, Object obj, Object... args) {
        System.out.println("invoke4");
    }

    public static void invoke(Object obj) {
        System.out.println("invoke2");
    }

    public static void main(String[] args) {
//        over.invoke(null, 1);
//        over.invoke(null, 1, 2);
//        over.invoke(null, new Object[]{1});

        // 5671234
        rotate(new int[]{1, 2, 3, 4, 5, 6, 7}, 3);

        // 4567123
        rotate(new int[]{1, 2, 3, 4, 5, 6, 7}, 4);


    }

    public static void rotate(int[] nums, int k) {
        for (int i = 0; i < k; i++) {
            int tmp = nums[0];
            for (int j = 1; j < nums.length; j++) {

                int t = nums[j];
                nums[j] = tmp;
                tmp = t;
                if (j == nums.length - 1) {
                    nums[0] = tmp;
                }
            }
        }

    }
}
